package com.accp.biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.accp.biz.UserBiz;
import com.accp.dao.DepartmentDao;
import com.accp.dao.UserDao;
import com.accp.entity.Department;
import com.accp.entity.User;

@Service
public class UserBizImpl implements UserBiz {
	@Resource
	private UserDao userDao;
	@Resource
	private DepartmentDao departmentDao;
	
	/*
	 * 关于用户的增删改查
	 */
	@Override
	public List<User> queryUsers(User u) {
		return userDao.queryUsers(u);
	}
	@Override
	public User queryUser(User u) {
		return userDao.queryUser(u);
	}
	@Override
	public boolean addUser(User u) {
		return userDao.addUser(u)>0;
	}
	@Override
	public boolean updateUser(User u) {
		return userDao.updateUser(u)>0;
	}
	@Override
	public boolean delUser(User u) {
		return userDao.delUser(u)>0;
	}

	/*
	 * 查询部门列表
	 */
	@Override
	public List<Department> queryDeparts() {
		return departmentDao.queryDeparts();
	}

	
}
